<?php

/**
 * Shop actions.
 *
 * @package    5
 * @subpackage Shop
 * @author     Your name here
 * @version    SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class ShopActions extends sfActions
{
  public function executeShow(sfWebRequest $request)
  {
    $pid = $request->getParameter('paper_id');
    $this->paper = Doctrine_Core::getTable('paper')->createQuery('p')
      ->leftJoin('p.explanations e')
      ->where('p.id = ?', $pid)
      ->andWhere('e.element_id = 1')
      ->andWhere('e.sub_element_id = 0')
      ->andWhere('e.cost > 0')
      ->fetchOne();
  }
}
